<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然企业级管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <div class="row h-home-path">
          <div class="col-md-12">
            <ol class="breadcrumb">
              <li><i class="fa fa-home"></i>&nbsp;&nbsp;所在位置</li>
              <li>首页</li>
              <li class="active">编辑数据库脚本导出配置信息</li>
            </ol>
          </div>
        </div>
        <div class="form-horizontal  h-form-warp">
          <div class="h-msg-title h-table-header">
            <strong>Oracle脚本导出配置表信息</strong>
          </div>
          <form action="/apiDatabaseScriptConfig/saveApiDatabaseScriptConfig" class="form-horizontal"
                id="apiDatabaseScriptConfigForm"
                method="post" role="form">
            <input class="form-control" id="id" name="id" type="hidden" value="${apiDatabaseScriptConfig.id!}">
            <input class="form-control" id="databaseId" name="databaseId" type="hidden"
                   value="${apiDatabaseScriptConfig.databaseId!}"/>
            <div class="form-group">
              <label class="col-sm-2 control-label">导出脚本前缀 ：</label>
              <div class="col-sm-8">
                <input class="form-control" id="tablePrefix" name="tablePrefix" placeholder="不填则导出全部"
                       type="text" value="${apiDatabaseScriptConfig.tablePrefix!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">负责人 ：</label>
              <div class="col-sm-8">
                <input class="form-control" id="author" name="author" required="required"
                       type="text" value="${apiDatabaseScriptConfig.author!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">数据库用户 ：</label>
              <div class="col-sm-8">
                <input class="form-control" id="databaseOwner" name="databaseOwner"
                       type="text"
                       value="${apiDatabaseScriptConfig.databaseOwner!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">表空间 ：</label>
              <div class="col-sm-8">
                <input class="form-control" id="tableSpace" name="tableSpace"
                       type="text" value="${apiDatabaseScriptConfig.tableSpace!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">索引表空间 ：</label>
              <div class="col-sm-8">
                <input class="form-control" id="indexSpace" name="indexSpace"
                       type="text" value="${apiDatabaseScriptConfig.indexSpace!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <@PageDict dict_name="exportScriptKind" dict_desc="导出脚本种类" dict_key="std_export_script_kind"
              dict_value="${apiDatabaseScriptConfig.exportScriptKind!}" dict_type="checkbox"
              label_class="col-sm-2 control-label text-right" dict_class="col-sm-8" required="required"
              default_value="01"/>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">导出脚本文件名 ：</label>
              <div class="col-sm-8">
                <input class="form-control" id="scriptVersion" name="scriptVersion"
                       required="required"
                       type="text" value="${apiDatabaseScriptConfig.scriptVersion!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
            <div class="form-group">
              <label class="col-sm-2 control-label">导出说明：</label>
              <div class="col-sm-8">
                <input class="form-control" id="exportComment" name="exportComment" required="required"
                       type="text" value="${apiDatabaseScriptConfig.exportComment!}"/>
              </div>
              <div class="col-sm-1">
                <span class="required">*</span>
              </div>
            </div>
          </form>
        </div>
      </div>
    </div>
    <!-- end: PAGE -->
  </div>
  <!-- end: MAIN CONTAINER -->
</div>

<#include "/common/jslib.html">
<!-- 弹窗下拉 -->
<script type="text/javascript">
    $(function () {
        // 弹出窗体控制
        var api = frameElement.api;
        var W = api.opener;
        ApiDatabaseScriptConfigMgr = {
            // 初始化
            init: function () {
                api.button({
                    id: 'ok',
                    name: '确认导出',
                    callback: ApiDatabaseScriptConfigMgr.exportDatabaseScript
                });
                api.button({
                    id: 'cancel',
                    name: '关闭'
                });
            },
            // init end

            // 提交数据
            exportDatabaseScript: function () {
                Jmts.ajaxSubmit(document.getElementById("apiDatabaseScriptConfigForm"), function (result) {
                    if (result.success) {
                        window.location.href = "/apiDatabaseScriptConfig/exportOracleScript?databaseId=" +
                            result.resultData.databaseId;
                    } else {
                        Jmts.warnTips(result.msg);
                    }
                });
                return false;
            }
            // submitForm end
        };
        // 执行初始化
        ApiDatabaseScriptConfigMgr.init();
        // 前台验证表单
        $("#apiDatabaseScriptConfigForm").validate();
    });
</script>
</body>
</html>
